<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
		<link href="css/fahuo.css" rel="stylesheet">

		<script src="http://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
		<!-- 引入组件库 -->
		<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript" src="../js/axios.js"></script>
<script type="text/javascript" src="../js/qs.js"></script>
		
	</head>

	<body >
		
				<div class="modal-content" style="background: #fff;box-shadow: 0px 0px 0px 0px ;border: 0px;">
								<div class="modal-header">
									<h4 class="modal-title">操作</h4>
								</div>
								<div class="modal-body">

									<!--所有的東西-->
									<!--这里是总的div放所有内容的-->
									<div class="allBaBox">
										<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" style="padding-left: 25px;">

											<form class="form-horizontal" id="subform" onsubmit="return checkDate();" action="/act/submit.xt" method="POST" target="popact_iframe">
												<input name="func" type="hidden" value="sendgoods"><input name="mdb" type="hidden" value="1a2c53">
												<p class="text-danger"><b>注意</b>：</p>
												<p>点击“确认发货”：</p>
												<ol>
													<li>该发货单状态变为“已发货”，不可恢复。</li>
													<li>发货后，发货明细不可修改。</li>
												</ol>
												<p>请确认以下信息后再发货：</p>
												
												<div class="form-group">
													<!--主题-->
													<el-row :gutter="20">
														<!--主题-->
														<el-col :span="4">
															<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">主题:</div>
														</el-col>
														<el-col :span="6" style="width: 220px;">
															<el-input v-model="ruleForm.title"  disabled :span="16" style="width: 450px;"></el-input>
														</el-col>

													</el-row>
												</div>

												<div class="form-group">
													<!--明细商品-->
													<el-row :gutter="20">
														<!--明细商品-->
														<el-col :span="4">
															<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">明细商品:</div>
														</el-col>
														<el-col :span="6" style="width: 220px;">
															<el-input v-model="ruleForm.goods" disabled :span="16" style="width: 450px;"></el-input>
														</el-col>

													</el-row>
												</div>
												
												
												<div class="form-group">
													<!--发货日期、最晚发货日期-->
													<div>
														<el-row :gutter="20">

															<!--发货日期-->
															<el-col :span="4">
																<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">发货日期:</div>
															</el-col>
															<el-col :span="18">
																<!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
																<el-form-item prop="havetime">
																	<el-date-picker v-model="ruleForm.havetime" type="date" placeholder="选择日期" style="width: 450px;">
																	</el-date-picker>
																</el-form-item>
															</el-col>

														</el-row>

													</div>
												</div>

												<div class="form-group">
													<!--发货金额、回款金额-->
													<el-row :gutter="20">
														<!--发货金额、汇款金额-->
														<el-col :span="4">
															<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">邮费金额:</div>
														</el-col>
														<el-col :span="6" style="width: 220px;">
														<el-form-item prop="havegmoney">
															<el-input v-model="ruleForm.havegmoney" type="number" :span="16" style="width: 450px;"></el-input>
																</el-form-item>
														</el-col>

													</el-row>
												</div>

												

												<p class="text-center">
													<input name="id" type="hidden" value="106">
													<input name="B1" class="btn btn-d waves-effect waves-light" type="button" value="确认发货" @click="submitForm('ruleForm')"></p>
											</form>
										</el-form>
									</div>
									<script type="text/javascript">
										var vm = new Vue({
											el: ".allBaBox",
											data: {

												ruleForm: {
													/*主题*/
													title:"",
													/*商品*/
													goods:"",
													/*邮费*/
													havegmoney: 0,
													/*发货时间*/
													havetime: "",
													/*发货详情id*/
													id:"",
													/*发货单id*/
													faid:"",
													/*订单Id*/
													oid:"",
													/*订单详情表id*/
													odid:""
												},
												rules: {

													havetime: [
														//数据类型要是date
														{
															type: 'date',
															required: true,
															message: '请选择日期',
															trigger: 'change'
														}
													],
													havegmoney: [{
														required: true,
														message: '请选择输入邮递费',
														trigger: 'blur'
													}]
												}

											},
											methods: {
												submitForm(formName) {
													//alert("ok");
													//验证方法
													this.$refs[formName].validate((valid) => {
														if(valid) {
															//post提交数据
															axios.post("/onSale/doFaHuoOk",
																//参数转换
																Qs.stringify(this.ruleForm, {
																	arrayFormat: 'brackets'
																})
																
															).then(function(v) {
																//alert("ok"+v.data);
																window.parent.location.href="/getFahuogx";
															}).catch(function(e) {
																alert("出错了"+e);
															});

														} else {
															console.log('error submit!!');
															return false;
														}
													});
												}
												
											},
											mounted() {
												var ss = ${textfahuo};
												console.info(ss); 
												this.ruleForm.title=ss.otitle;
												this.ruleForm.goods=ss.goo_name;
												this.ruleForm.id=ss.ded_id;
												this.ruleForm.faid=ss.ds_id;
												this.ruleForm.oid=ss.o_id;
												this.ruleForm.odid=ss.od_id;
											}

										});
									</script>

									<!--所有的東西-->

								</div>
								<div class="modal-footer">
									<div id="editsublayer" style="position:absolute; visibility:hidden;&#9;left:0;&#9;top:0; width:0;&#9;height:0;">
										<iframe name="popact_iframe" id="popact_iframe" src="/a.html" scrolling="no" style="width: 0; height: 0; border: 0;"></iframe></div>

								</div>
							</div>
					
					
	</body>

</html>